package remote.skins
{
	import flash.display.Graphics;
	
	import remote.ISelect;
	import remote.controls.Component;
	import remote.skins.brushes.SolidBrush;
	
	
	/**
	 * 单选按钮皮肤
	 * @createDate 2011-3-4
	 * @author 徐俊杰
	 */
	public class RadioButtonIconSkin extends ButtonSkin implements ISkin
	{
		public function RadioButtonIconSkin()
		{
			super();
		}
		
		override public function draw(target:Component):void
		{
			var brush:SolidBrush = getBrush(target);
			var g:Graphics = target.graphics;
			g.clear();
			g.lineStyle(brush.borderThickness, brush.borderColor, brush.borderAlpha);
			g.beginFill(0, 0);
			g.drawEllipse(0, 0, target.width, target.height);
			g.endFill();
			if((target as ISelect).selected)
			{
				g.lineStyle(brush.borderThickness, brush.borderColor, brush.borderAlpha);
				g.beginFill(brush.backgroundColor, brush.backgroundAlpha);
				g.drawEllipse(3, 3, target.width - 6, target.height - 6);
				g.endFill();
			}
		}
	}
}